package com.fh.shop.api.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000121653270";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCM4mpPfLJFpKXSuOTO3ptnSRCNcQ7ZBrStyGQlPn5msvaYAIa+BEwH3SjcuFs0oYsVtg4QRhGQ+oDW8aP4n6u5LXZGET4mnfuY+hfyWMfEWUGc2tB/GLZO/zFYdyTr5+z1fSfqpPWayniHo4l0gSVIeKSUsSkA+Zl0vXthwxatofT7MDpUI+0w9jGgEBfjI8iIGinqOxevkEeOAFyGHHFEOGYwKmeiXRvbGy8OD22JEnGdtdvXEGskq+VNx8jR4+OyRkDEde1H44n4hQ5VlDkEH7PI2CxNUVf6vfQY78v7OXgXV0GEDuS7hz5qtEUOmqGfpmLsPh3b5H7ZueDnVxOlAgMBAAECggEAMQjU65mBCtBFjtQffwjnmclKY5BIFK1K0Xl/sZ7Qq7n6Lelw/E3OkKYfBMN9qxHWsNXOi0d38bfeg/FSmsQoJql2EukJcrNl0FarYwQXc3WFaqyWCMZ3HYOgjyPYy+rLBJ5s+DQ174ws6zi2LMCOU2z6C26l0NsO2BzjBqG6EPBbcX46zqfERQR8dx9JMd3RZj/pPvAdq0/kCzZ1y4VfoGLBzji2UnKaUKsxkBXD04b9Ys98oQ8fENpDEeZpHgVzlg/eRF8mojLTU+ZCsgCVmcfMwZYxym4vqWOsDNb6kGQI2UJnEk7XGSEpUriXctf6KkOFiwPQ+2AQgTlDKgN5+QKBgQDCeCLRUhZo4fsA9WWJ6wEAKIJZ107cDby48rxGIIA4nlUe5lEgIMw6bzTCTKTuf/e6qYC+f0fdkMJhCzfZdgSBTiR/DJIGqC2Qu2Bg5uSYcDsQEuQ3IAr3yQcA4DmKdQTWrgsw0+J1RSxsY03XV+45mYQ3RO/HxlVAU48NliJqFwKBgQC5dfKJ4cTCDKqXXOSB4VdtcVVVIENXFyK7fJlChsuR8SsavnlQt/FkHKuRax4XDMECTvKzy1b5L4R225Wf++LHM/IfOhXVJT/6jhbYCFELA5H2uVqoERrlcK8ZpNL+cHiKAfw4UgMpz9KiODjFWamW2B9BMip9VFSA7Z/34+4RowKBgGSyLl0y4zW15fHOH6C1lhQN5ck9arEZT+J4ljK9u4cVvT+9xL4dHYMYeDov06tHifAWuvppD75TqcL0OxwYNyb5Xn6G9MoLpWRvEe27QR0J6BtfnNpKdkNtzXmPoVvnUfUTs+m5nWZZxjHtja328vzSWBsCUCKiuRwQ6F8BoZpLAoGAXnayPALP+lsDRSeeiH0jz+3rHfnZ8vEo0sBrO9R2ufZSE0QzfKbEgE6OIPqjj/ACG0/lFSkcOr42RWghNSTSZM6To84tMqzPgqp+/jh2NxrxbO8KOxLDVVxpA7HNeqYE756FPpafX9uoGNJ0MCk0VU3t1YJc3AtpI2ZllZj2OOsCgYALfeDpsH62oW0n2z6jxXMwY20VQZwJmv/7WyupD6RdW/9LwQ5zoaO1E4rQHq14gCKEG8jc79SolqaDXwh+8f1JUbY1SxaBoe3iJx+A1i4286m23lHjHgplMdhz7jxMDfkpWfVZXZu0b9E2s2JkyRMCGCbIW2HQmHGFK5YzUk2DrA==";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk/TbL9UMtrgP9hA4ORO0k9XLOeFlBB8YeBM5XTc4PsclRpnCbuxJiNx+nJsc6HP3AYEBRhV1qTZ43746fA775mRDDLZzxvvHbf/pQv7UIxpxeyoX8A870xrcRWW6GdAftqRPNsaMT59ycm6Cs9d9LEitOJHjI5wyIUcYTAiL+NdcO6GZcqbsIB9u4ppa+bYup/iPcKeYs3Qnr2KBw12tqKDQUOsWCe6Bc9F1Z+zEcYtuShwonr2EkPjtEzbNOp/dgaHFShiaOcr6e+O/Qq8dC07KT3MVIQMMZXCrkZC7kCKWwIWX5qBYkAdUhzi5T7/s3iJrIP+f9K2ni3k9teKnhQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://fmnrik.natappfree.cc/api/pay/aliNotify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://fmnrik.natappfree.cc/api/pay/aliReturn";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 日志记录
	public static String log_path = "C:\\";

	//商家账号
	public static String seller_id = "2088621991112062";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

